<template>
  <div style="text-align: left;">
  
    <div style="margin-bottom: 10px;text-align: left;font-weight: bold;font-size:17px;line-height: 1.3;">
      <span v-show="item.optional" style="color:red;font-size: 20px;float:left;">* </span>
      <span v-show="autoId">{{num+1}}.</span><span>{{item.title}}</span>
    </div>
    <div v-if="item.remark.trim()!=''" style="margin-bottom: 20px;text-align: left;font-size:14px;line-height: 1.3;color:grey">
      说明：{{item.remark}}
    </div>
    
    <div style="padding: 0;margin: 0 0 10px 0;">
      <el-checkbox-group v-model="checkedList" @change="provideanswer">
        <el-checkbox
            v-for="(op) in item.option"
            :key="op.id"
            :label="op.id"
            style="margin:0 0 5px 0;display: block;">{{op.description}}</el-checkbox>
      </el-checkbox-group>
    </div>
    
 

  
  </div>
</template>
<script>
export default {
  name:'SingleChoice',
  components:{
    
  },
  data(){
    return{
      checkedList:[]
    }
  },
  props:{
    item:Object,
    id:Number,
    editIcon:String,
    autoId:Boolean,
    num:Number
  },
  computed:{
    
  },

  methods:{
   provideanswer(){
     console.log('test2')
      let data={
        id:this.item.id,
        answer:this.checkedList
      };
      this.$emit('sendanswer',data)

   }
  }
}
</script>